// 团队选择/创建页面逻辑
Page({
  data: {
    teamName: '',
    teams: ['团队A', '团队B', '团队C'] // 模拟已有团队列表
  },
  // 输入团队名称
  inputTeamName: function(e) {
    this.setData({
      teamName: e.detail.value
    })
  },
  // 创建团队
  createTeam: function() {
    if (this.data.teamName) {
      this.data.teams.push(this.data.teamName)
      this.setData({
        teams: this.data.teams,
        teamName: ''
      })
    }
  },
  // 选择团队
  selectTeam: function(e) {
    const teamName = e.currentTarget.dataset.teamname
    wx.setStorageSync('currentTeam', teamName)
    wx.navigateTo({
      url: '/pages/home/home',
    })
  }
})
